#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

void solve(){
    int n;
    cin>>n;

   	cout<<"1 1 "<<n<<'\n';
   	cout.flush();
   	ll sum,sum1;
   	cin>>sum;
   	cout<<"2 1 "<<n<<'\n';
   	cout.flush();
   	cin>>sum1;
   	sum1-=sum;

   	int l=1,r=n,res=0;
   	while(l<=r){
   		int mid=l+r>>1;
   		int t1,t2;
   		cout<<"1 1 "<<mid<<'\n';
   		cout.flush();
   		cin>>t1;
   		cout<<"2 1 "<<mid<<'\n';
   		cout.flush();
   		cin>>t2;
   		if(t2-t1<sum1){
   			l=mid+1;
   		}else{
   			r=mid-1;
   			res=mid;
   		}
   	}
   	cout<<"! "<<res-sum1+1<<' '<<res<<'\n';
   	cout.flush();
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int t=1;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}